prepare($query); $stmt->execute([$result_id]); $result = $stmt->fetch(PDO::FETCH_ASSOC); if (!$result) { $_SESSION['error'] = "Result not found!"; redirect('view_results.php'); } // Get student answers for this result $query = " SELECT sa.*, q.question_text, q.option_a, q.option_b, q.option_c, q.option_d, q.correct_answer, q.marks FROM student_answers sa JOIN questions q ON sa.question_id = q.id WHERE sa.session_id = ? ORDER BY sa.question_id "; $stmt = $pdo->prepare($query); $stmt->execute([$result['session_id']]); $student_answers = $stmt->fetchAll(PDO::FETCH_ASSOC); // Calculate statistics $total_questions = $result['total_questions']; $correct_answers = $result['correct_answers']; $wrong_answers = $result['total_questions'] - $result['correct_answers']; $percentage = $result['percentage']; $questions_attempted = $result['questions_attempted']; $questions_skipped = $total_questions - $questions_attempted; // Calculate time taken $start_time = new DateTime($result['start_time']); $end_time = new DateTime($result['end_time']); $duration = $start_time->diff($end_time); $duration_display = $duration->h > 0 ? sprintf('%dh %dm %ds', $duration->h, $duration->i, $duration->s) : sprintf('%dm %ds', $duration->i, $duration->s); // Determine performance level if ($percentage >= 80) { $performance_level = 'Excellent'; $performance_class = 'text-success'; } elseif ($percentage >= 60) { $performance_level = 'Good'; $performance_class = 'text-primary'; } elseif ($percentage >= 40) { $performance_level = 'Average'; $performance_class = 'text-warning'; } else { $performance_level = 'Poor'; $performance_class = 'text-danger'; } ?> Result Details - Admin

Result Details

Detailed analysis of student performance

← Back to Results

Overall Score

%

Correct Answers

/

Questions

Wrong Answers

Questions

Time Taken

Duration

Student Information

Name
Registration Number
Student ID

Exam Information

Exam Name
Year
Start Time
End Time

Question-wise Analysis

0): ?> $answer): ?>
Q:
Marks:
$answer['option_a'], 'B' => $answer['option_b'], 'C' => $answer['option_c'], 'D' => $answer['option_d'] ]; foreach ($options as $letter => $option_text): if (!empty($option_text)): $option_class = ''; if ($letter == $answer['correct_answer']) { $option_class = 'correct'; } if ($letter == $answer['selected_answer']) { $option_class .= $answer['is_correct'] ? ' selected correct' : ' selected incorrect'; } ?>
.
Correct Answer:

No detailed answer data available for this result.

↑ Back to Top